<template>
  <view class="share" v-if="isShow">
    <!-- 遮罩层 -->
    <view class="mask" @click="showHandler(false)"></view>
    <!-- 分享列表 -->
    <view class="share-list">
      <scroll-view scroll-x>
        <view class="share-item" >
          <image src="/static/share/weixin.png"></image>
          <view>微信好友</view>
        </view>
        <view class="share-item" >
          <image src="/static/share/pengyouquan.png"></image>
          <view>微信朋友圈</view>
        </view>
        <view class="share-item" >
          <image src="/static/share/weibo.png"></image>
          <view>新浪微博</view>
        </view>
        <view class="share-item" >
          <image src="/static/share/qq.png"></image>
          <view>QQ好友</view>
        </view>
        <view class="share-item" >
          <image src="/static/share/link.png"></image>
          <view>复制链接</view>
        </view>
      </scroll-view>
      <view class="share-cancel" @click="showHandler(false)">取消</view>
    </view>
    
  </view>
</template>

<script>
  export default {
    data() {
      return {
        isShow: false
      }
    },
    methods: {
      showHandler(flag = false) {
        this.isShow = flag
        uni.getProvider({
          service:'share',
          success: res => {
            console.log('获取服务提供商' ,res)
          }
        })
      }
    }
  }
</script>

<style lang="scss">
  .share {
    .mask {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 99;
      background-color: rgba(0,0,0,0.6);
    }
    .share-list {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 100;
      scroll-view {
        background-color: #F7F7F7;
        width: 100%;
        height: 200rpx;
        white-space: nowrap;
        padding-top: 45rpx;
        .share-item {
          width: 25%;
          display: inline-flex;
          flex-direction: column;
          justify-content: center;
          align-items: center;
          
          image {
            width: 60rpx;
            height: 60rpx;
            border-radius: 100%;
          }
          view{
            color: $mxg-text-color-grey;
            font-size: 25rpx;
            padding-top: 10rpx;
          }
        }
      }
    }
    .share-cancel {
      padding: 25rpx 0;
      width: 100%;
      text-align: center;
      background-color: #FFFFFF;
    }
  }
</style>
